﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
    <!--Thumb Style-->
    <Style x:Key="HorizontalSliderThumb" TargetType="Thumb">
        <Setter Property="Background" Value="{DynamicResource GrayBrush7}" />
        <Setter Property="BorderThickness" Value="1" />
        <Setter Property="IsTabStop" Value="False" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="Thumb">
                    <Grid>
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal" />
                                <VisualState x:Name="MouseOver">
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Opacity"
                                                                       Storyboard.TargetName="DisabledVisualElement">
                                            <SplineDoubleKeyFrame KeyTime="0" Value=".55" />
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Pressed">
                                    <Storyboard />
                                </VisualState>
                                <VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Opacity"
                                                                       Storyboard.TargetName="DisabledVisualElement">
                                            <SplineDoubleKeyFrame KeyTime="0" Value=".55" />
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="FocusStates">
                                <VisualState x:Name="Focused" />
                                <VisualState x:Name="Unfocused" />
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Border Background="{DynamicResource BlackBrush}"
                                BorderThickness="0,0,1,0"
                                CornerRadius="2.5"
                                Opacity=".55"
                                BorderBrush="{DynamicResource ControlBackgroundBrush}" />
                        <Rectangle x:Name="DisabledVisualElement"
                                   Fill="{DynamicResource DisabledWhiteColorBrush}"
                                   IsHitTestVisible="false"
                                   Opacity=".4" />
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!--VerticalSliderThumb-->
    <Style x:Key="VerticalSliderThumb" TargetType="Thumb">
        <Setter Property="Background" Value="{DynamicResource TransparentWhiteBrush}" />
        <Setter Property="BorderThickness" Value="1" />
        <Setter Property="IsTabStop" Value="False" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="Thumb">
                    <Grid>
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal" />
                                <VisualState x:Name="MouseOver">
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Opacity"
                                                                       Storyboard.TargetName="DisabledVisualElement">
                                            <SplineDoubleKeyFrame KeyTime="0"
                                                                  Value=".55" />
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Pressed">
                                    <Storyboard />
                                </VisualState>
                                <VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Opacity"
                                                                       Storyboard.TargetName="DisabledVisualElement">
                                            <SplineDoubleKeyFrame KeyTime="0"
                                                                  Value=".55" />
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="FocusStates">
                                <VisualState x:Name="Focused" />
                                <VisualState x:Name="Unfocused" />
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Border Background="{DynamicResource BlackBrush}"
                                BorderThickness="0,1,0,0"
                                CornerRadius="2.5"
                                Opacity=".55"
                                BorderBrush="{DynamicResource ControlBackgroundBrush}" />
                        <Rectangle x:Name="DisabledVisualElement"
                                   Fill="{DynamicResource DisabledWhiteColorBrush}"
                                   IsHitTestVisible="false"
                                   Opacity=".4" />
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!--RepeatButtonTemplate-->
    <ControlTemplate x:Key="RepeatButtonTemplate">
        <Grid x:Name="Root" Opacity="0" />
    </ControlTemplate>
    <!--HorizontalTrackLargeDecrease-->

    <Style x:Key="HorizontalTrackLargeDecrease" TargetType="{x:Type RepeatButton}">
        <Setter Property="OverridesDefaultStyle" Value="true" />
        <Setter Property="IsTabStop" Value="false" />
        <Setter Property="Focusable" Value="false" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type RepeatButton}">
                    <Grid x:Name="Root"
                          Margin="0,-1,0,0">
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal" />
                                <VisualState x:Name="MouseOver" />
                                <VisualState x:Name="Pressed" />
                                <VisualState x:Name="Disabled" />
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Rectangle Height="3"
                                   Margin="0,1,0,0">
                            <Rectangle.Fill>
                                <SolidColorBrush Color="{DynamicResource Gray6}" />
                            </Rectangle.Fill>
                        </Rectangle>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>

    </Style>
    <Style x:Key="HorizontalTrackValue" TargetType="{x:Type RepeatButton}">
        <Setter Property="OverridesDefaultStyle" Value="true" />
        <Setter Property="IsTabStop" Value="false" />
        <Setter Property="Focusable" Value="false" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type RepeatButton}">
                    <Grid x:Name="Root"
                          Margin="0,-1,0,0">
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal" />
                                <VisualState x:Name="MouseOver" />
                                <VisualState x:Name="Pressed" />
                                <VisualState x:Name="Disabled" />
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Rectangle Height="5"
                                   Margin="0,1,0,0">
                            <Rectangle.Fill>
                                <!--<SolidColorBrush Color="{DynamicResource AccentColor}" />-->
                                <LinearGradientBrush StartPoint="0.5,0" EndPoint="0.5,1">
                                    <GradientStop Color="{TemplateBinding Background}" Offset="0.0" />
                                    <GradientStop Color="{DynamicResource AccentColor}" Offset="0.25" />
                                    <GradientStop Color="{DynamicResource AccentColor}" Offset="0.75" />
                                    <GradientStop Color="{TemplateBinding Background}" Offset="1.0" />
                                </LinearGradientBrush>
                            </Rectangle.Fill>
                        </Rectangle>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!--VerticalTrackLargeDecrease-->
    <ControlTemplate x:Key="VerticalTrackLargeDecrease" TargetType="RepeatButton">
        <Grid x:Name="Root" Margin="0,0,0,0">
            <Rectangle Width="3">
                <Rectangle.Fill>
                    <SolidColorBrush Color="{DynamicResource BlackColor}" />
                </Rectangle.Fill>
            </Rectangle>
        </Grid>
    </ControlTemplate>

    <!--Slider Style-->
    <Style TargetType="Slider" x:Key="MetroSlider">
        <Setter Property="BorderThickness" Value="1" />
        <Setter Property="Maximum" Value="100" />
        <Setter Property="Minimum" Value="0" />
        <Setter Property="Value" Value="0" />
        <Setter Property="BorderBrush" Value="{DynamicResource ControlBorderBrush}" />
        <Setter Property="IsTabStop" Value="False" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="Slider">
                    <Grid x:Name="Root">
                        <Grid.Resources>
                            <ControlTemplate x:Key="RepeatButtonTemplate">
                                <Grid x:Name="Root" Opacity="0" />
                            </ControlTemplate>
                        </Grid.Resources>
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal" />
                                <VisualState x:Name="MouseOver" />
                                <VisualState x:Name="Disabled" />
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="FocusStates">
                                <VisualState x:Name="Unfocused" />
                                <VisualState x:Name="Focused" />
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Grid x:Name="HorizontalTemplate"
                              Background="{TemplateBinding Background}">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto" />
                                <ColumnDefinition Width="Auto" />
                                <ColumnDefinition Width="*" />
                            </Grid.ColumnDefinitions>
                            <Track x:Name="PART_Track"
                                   Grid.ColumnSpan="3"
                                   Grid.Column="0"
                                   Height="18">
                                <Track.DecreaseRepeatButton>
                                    <RepeatButton Command="{x:Static Slider.DecreaseLarge}"
                                                  Style="{StaticResource HorizontalTrackValue}" />
                                </Track.DecreaseRepeatButton>
                                <Track.IncreaseRepeatButton>
                                    <RepeatButton Command="{x:Static Slider.IncreaseLarge}"
                                                  Style="{StaticResource HorizontalTrackLargeDecrease}" />
                                </Track.IncreaseRepeatButton>
                                <Track.Thumb>
                                    <Thumb x:Name="HorizontalThumb"
                                           Grid.Column="1"
                                           Height="18"
                                           IsTabStop="True"
                                           Width="10"
                                           Style="{StaticResource HorizontalSliderThumb}" />
                                </Track.Thumb>
                            </Track>
                        </Grid>
                    </Grid>
                    <ControlTemplate.Triggers>
                        <Trigger Property="TickPlacement"
                                 Value="TopLeft">
                            <Setter Property="Style"
                                    TargetName="HorizontalThumb"
                                    Value="{StaticResource HorizontalSliderThumb}" />
                        </Trigger>
                        <Trigger Property="TickPlacement"
                                 Value="BottomRight">
                            <Setter Property="Style"
                                    TargetName="HorizontalThumb"
                                    Value="{StaticResource HorizontalSliderThumb}" />
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>

        <Setter Property="Foreground" Value="{DynamicResource TextBrush}" />
    </Style>
</ResourceDictionary>